Thedc2013::Application.routes.draw do
  devise_for :admin_users, ActiveAdmin::Devise.config
  ActiveAdmin.routes(self)

  root to: 'static_pages#home'

  match '/about', to: 'static_pages#about', via: 'get'
  match '/doc', to: 'static_pages#doc', via: 'get'
  match '/informs', to: 'static_pages#informs', via: 'get'

  match '/signup', to: 'users#new', via: 'get'
  match '/signout', to: 'sessions#destroy', via: 'delete'

  resources :users
  match 'users/:id/delete', to: 'users#delete', via: 'get', as: 'delete_user'

  resources :teams
  match 'teams/:id/delete', to: 'teams#delete', via: 'get', as: 'delete_team'

  resources :memberships, only: [:destroy]

  resources :invitations, only: [:destroy]
  match 'invitations/create/:user_id', to: 'invitations#create', via: 'post', as: 'invite_user'
  match 'invitations/:id/accept', to: 'invitations#accept', via: 'post', as: 'accept_invitation'
  match 'invitations/:id/decline', to: 'invitations#decline', via: 'post', as: 'decline_invitation'
  match 'invitations/:id/cancel', to: 'invitations#cancel', via: 'post', as: 'cancel_invitation'

  match 'applies/create/:team_id', to: 'applies#create', via: 'post', as: 'apply_team'
  match 'applies/:id/accept', to: 'applies#accept', via: 'post', as: 'accept_apply'
  match 'applies/:id/decline', to: 'applies#decline', via: 'post', as: 'decline_apply'
  match 'applies/:id/cancel', to: 'applies#cancel', via: 'post', as: 'cancel_apply'

  resources :sessions, only: [:create, :destroy]
  resources :events, only: [:index, :show]
  resources :posts
  resources :replies, only: [:create]
  resources :informs, only: [:index, :show]
  
end
